/**
 */
package sdmakerz_v2.sdedit_extension.sDMakerV2.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import sdmakerz_v1.coresyntax.sDMakerV1.SDMakerV1Package;

import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditAlt;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditCall;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditCombinableDiagElt;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditCombinedFragment;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditLoop;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditModel;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditObj;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDEditOpt;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDMakerV2Factory;
import sdmakerz_v2.sdedit_extension.sDMakerV2.SDMakerV2Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class SDMakerV2PackageImpl extends EPackageImpl implements SDMakerV2Package
{
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditModelEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditObjEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditCombinableDiagEltEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditCallEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditCombinedFragmentEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditAltEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditLoopEClass = null;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private EClass sdEditOptEClass = null;

  /**
   * Creates an instance of the model <b>Package</b>, registered with
   * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
   * package URI value.
   * <p>Note: the correct way to create the package is via the static
   * factory method {@link #init init()}, which also performs
   * initialization of the package, or returns the registered package,
   * if one already exists.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see org.eclipse.emf.ecore.EPackage.Registry
   * @see sdmakerz_v2.sdedit_extension.sDMakerV2.SDMakerV2Package#eNS_URI
   * @see #init()
   * @generated
   */
  private SDMakerV2PackageImpl()
  {
    super(eNS_URI, SDMakerV2Factory.eINSTANCE);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private static boolean isInited = false;

  /**
   * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
   * 
   * <p>This method is used to initialize {@link SDMakerV2Package#eINSTANCE} when that field is accessed.
   * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #eNS_URI
   * @see #createPackageContents()
   * @see #initializePackageContents()
   * @generated
   */
  public static SDMakerV2Package init()
  {
    if (isInited) return (SDMakerV2Package)EPackage.Registry.INSTANCE.getEPackage(SDMakerV2Package.eNS_URI);

    // Obtain or create and register package
    SDMakerV2PackageImpl theSDMakerV2Package = (SDMakerV2PackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SDMakerV2PackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SDMakerV2PackageImpl());

    isInited = true;

    // Initialize simple dependencies
    SDMakerV1Package.eINSTANCE.eClass();

    // Create package meta-data objects
    theSDMakerV2Package.createPackageContents();

    // Initialize created meta-data
    theSDMakerV2Package.initializePackageContents();

    // Mark meta-data to indicate it can't be changed
    theSDMakerV2Package.freeze();

  
    // Update the registry and return the package
    EPackage.Registry.INSTANCE.put(SDMakerV2Package.eNS_URI, theSDMakerV2Package);
    return theSDMakerV2Package;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditModel()
  {
    return sdEditModelEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getSDEditModel_Elements()
  {
    return (EReference)sdEditModelEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditObj()
  {
    return sdEditObjEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getSDEditObj_Name()
  {
    return (EAttribute)sdEditObjEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getSDEditObj_Type()
  {
    return (EReference)sdEditObjEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditCombinableDiagElt()
  {
    return sdEditCombinableDiagEltEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditCall()
  {
    return sdEditCallEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getSDEditCall_Caller()
  {
    return (EAttribute)sdEditCallEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getSDEditCall_Called()
  {
    return (EAttribute)sdEditCallEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EAttribute getSDEditCall_Name()
  {
    return (EAttribute)sdEditCallEClass.getEStructuralFeatures().get(2);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getSDEditCall_Params()
  {
    return (EReference)sdEditCallEClass.getEStructuralFeatures().get(3);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditCombinedFragment()
  {
    return sdEditCombinedFragmentEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditAlt()
  {
    return sdEditAltEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getSDEditAlt_Conseq()
  {
    return (EReference)sdEditAltEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getSDEditAlt_Alters()
  {
    return (EReference)sdEditAltEClass.getEStructuralFeatures().get(1);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditLoop()
  {
    return sdEditLoopEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getSDEditLoop_Body()
  {
    return (EReference)sdEditLoopEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EClass getSDEditOpt()
  {
    return sdEditOptEClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EReference getSDEditOpt_Opts()
  {
    return (EReference)sdEditOptEClass.getEStructuralFeatures().get(0);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SDMakerV2Factory getSDMakerV2Factory()
  {
    return (SDMakerV2Factory)getEFactoryInstance();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isCreated = false;

  /**
   * Creates the meta-model objects for the package.  This method is
   * guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void createPackageContents()
  {
    if (isCreated) return;
    isCreated = true;

    // Create classes and their features
    sdEditModelEClass = createEClass(SD_EDIT_MODEL);
    createEReference(sdEditModelEClass, SD_EDIT_MODEL__ELEMENTS);

    sdEditObjEClass = createEClass(SD_EDIT_OBJ);
    createEAttribute(sdEditObjEClass, SD_EDIT_OBJ__NAME);
    createEReference(sdEditObjEClass, SD_EDIT_OBJ__TYPE);

    sdEditCombinableDiagEltEClass = createEClass(SD_EDIT_COMBINABLE_DIAG_ELT);

    sdEditCallEClass = createEClass(SD_EDIT_CALL);
    createEAttribute(sdEditCallEClass, SD_EDIT_CALL__CALLER);
    createEAttribute(sdEditCallEClass, SD_EDIT_CALL__CALLED);
    createEAttribute(sdEditCallEClass, SD_EDIT_CALL__NAME);
    createEReference(sdEditCallEClass, SD_EDIT_CALL__PARAMS);

    sdEditCombinedFragmentEClass = createEClass(SD_EDIT_COMBINED_FRAGMENT);

    sdEditAltEClass = createEClass(SD_EDIT_ALT);
    createEReference(sdEditAltEClass, SD_EDIT_ALT__CONSEQ);
    createEReference(sdEditAltEClass, SD_EDIT_ALT__ALTERS);

    sdEditLoopEClass = createEClass(SD_EDIT_LOOP);
    createEReference(sdEditLoopEClass, SD_EDIT_LOOP__BODY);

    sdEditOptEClass = createEClass(SD_EDIT_OPT);
    createEReference(sdEditOptEClass, SD_EDIT_OPT__OPTS);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private boolean isInitialized = false;

  /**
   * Complete the initialization of the package and its meta-model.  This
   * method is guarded to have no affect on any invocation but its first.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void initializePackageContents()
  {
    if (isInitialized) return;
    isInitialized = true;

    // Initialize package
    setName(eNAME);
    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Obtain other dependent packages
    SDMakerV1Package theSDMakerV1Package = (SDMakerV1Package)EPackage.Registry.INSTANCE.getEPackage(SDMakerV1Package.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    sdEditCallEClass.getESuperTypes().add(this.getSDEditCombinableDiagElt());
    sdEditCombinedFragmentEClass.getESuperTypes().add(this.getSDEditCombinableDiagElt());
    sdEditAltEClass.getESuperTypes().add(this.getSDEditCombinedFragment());
    sdEditLoopEClass.getESuperTypes().add(this.getSDEditCombinedFragment());
    sdEditOptEClass.getESuperTypes().add(this.getSDEditCombinedFragment());

    // Initialize classes and features; add operations and parameters
    initEClass(sdEditModelEClass, SDEditModel.class, "SDEditModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getSDEditModel_Elements(), ecorePackage.getEObject(), null, "elements", null, 0, -1, SDEditModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(sdEditObjEClass, SDEditObj.class, "SDEditObj", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getSDEditObj_Name(), ecorePackage.getEString(), "name", null, 0, 1, SDEditObj.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getSDEditObj_Type(), theSDMakerV1Package.getType(), null, "type", null, 0, 1, SDEditObj.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(sdEditCombinableDiagEltEClass, SDEditCombinableDiagElt.class, "SDEditCombinableDiagElt", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(sdEditCallEClass, SDEditCall.class, "SDEditCall", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEAttribute(getSDEditCall_Caller(), ecorePackage.getEString(), "caller", null, 0, 1, SDEditCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getSDEditCall_Called(), ecorePackage.getEString(), "called", null, 0, 1, SDEditCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getSDEditCall_Name(), ecorePackage.getEString(), "name", null, 0, 1, SDEditCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getSDEditCall_Params(), theSDMakerV1Package.getExpression(), null, "params", null, 0, -1, SDEditCall.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(sdEditCombinedFragmentEClass, SDEditCombinedFragment.class, "SDEditCombinedFragment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(sdEditAltEClass, SDEditAlt.class, "SDEditAlt", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getSDEditAlt_Conseq(), this.getSDEditCombinableDiagElt(), null, "conseq", null, 0, -1, SDEditAlt.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getSDEditAlt_Alters(), this.getSDEditCombinableDiagElt(), null, "alters", null, 0, -1, SDEditAlt.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(sdEditLoopEClass, SDEditLoop.class, "SDEditLoop", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getSDEditLoop_Body(), this.getSDEditCombinableDiagElt(), null, "body", null, 0, -1, SDEditLoop.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    initEClass(sdEditOptEClass, SDEditOpt.class, "SDEditOpt", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getSDEditOpt_Opts(), this.getSDEditCombinableDiagElt(), null, "opts", null, 0, -1, SDEditOpt.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Create resource
    createResource(eNS_URI);
  }

} //SDMakerV2PackageImpl
